Repository navigation
feat(cinder): add project and volume-type quota metrics - #162
Open
Jeremy Lee (legit-ninja) wants to merge 6 commits into
Open
Jeremy Lee (legit-ninja) wants to merge 6 commits into
Jeremy Lee (legit-ninja) wants to merge 6 commits into
Conversation
Export stored limits and rebuilt usage for seven Octavia resources, with project metadata fallback, defaults configuration, bounded SQL reads and separate quota health. Preserve inventory and other service registration. Requires the public openstackdb quota APIs; keep the canonical dependency until those APIs are accepted upstream. Validate through an external Go workspace in the meantime. Signed-off-by: David Hulick <dave.hulick@gmail.com>
Extend the existing full-exporter fixture with distinct resource counts, nullable and explicit limits, deleted resources and an idle project. Assert every quota family and preserve existing service assertions. Integration-tag vet passes; native MariaDB execution is pending because Docker is unavailable in the preparation environment. Signed-off-by: David Hulick <dave.hulick@gmail.com>
Signed-off-by: David Hulick <dave.hulick@gmail.com>
Read persisted project limits, usage, defaults and active volume types independently. Preserve signed accounting and isolate ambiguous resources with sanitized diagnostics. Extend shared configuration and register one quota collector while retaining the limits adapter. Expose Cinder capacities in bytes and add domain identity to quota capacities. Keep inventory attachment-row behavior for the separate deduplication fix. Requires the public openstackdb Cinder and Octavia quota APIs. Keep the canonical library requirement and validate through an external workspace. Short and race tests, vet, build and module verification pass; native database validation is blocked by unavailable Docker. Signed-off-by: David Hulick <dave.hulick@gmail.com>
Extend the existing Cinder fixture with nullable overrides, default-class limits, signed accounting, deleted rows, typed resources and idle and usage-only projects. Check all sixteen quota families, exact labels and gauge values, inventory bytes and retired capacity names. Preserve the existing service fixtures, Octavia quota assertions and Nova task-state check. Integration-tag vet passes; native MariaDB execution is blocked because Docker is unavailable. Signed-off-by: David Hulick <dave.hulick@gmail.com>
The staged openstackdb Cinder quota rework removed the QuotaRepository wrapper and renamed several query methods, leaving the exporter unable to compile against the updated API. Update the Cinder quota collector to use the generated Queries API directly and adjust the associated test expectations. Preserve existing quota accounting, default precedence, error handling, and Prometheus metric behavior. Verified against the combined staged Cinder and Octavia openstackdb APIs with successful build, vet, and targeted unit tests. Signed-off-by: David Hulick <dave.hulick@gmail.com>
This was referenced Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #161 (Octavia quotas, shared quota configuration). This branch contains #161's three commits; the Cinder changes are the last three commits. Merge #161 first.
Summary
Add a Cinder quota collector, keeping the limits collector as a thin adapter, that reads Cinder's persisted quota accounting: project limits, usage and reservations, default-class limits, and per-volume-type quotas. Cinder capacity metrics move to bytes.
Metrics
All quota metrics have
tenant,tenant_idanddomain_idlabels; volume-type metrics also havevolume_type(the full type name). Prefixopenstack_cinder_:The first five also gain a
domain_idlabel, which changes series identity. Theopenstack_cinder_volume_statussizelabel stays in GiB, and volume inventory labels are unchanged. Only unlimited (-1) limits stay unscaled.Dependencies
QuotaGetAllByProject,QuotaUsageGetAllByProjectandQuotaClassGetDefaultsfrom vexxhost/openstackdb#10, plus feat(octavia): add project quota monitoring #161's dependency vexxhost/openstackdb#11.go.modneeds bumping to a release that includes them.PR #159 also changes the Cinder volumes collector; whichever merges second needs its README section reconciled.
Tests
Built and tested (
> [!NOTE] > Stacked on #161 (Octavia quotas, shared quota configuration). This branch contains #161's three commits; the Cinder changes are the last three commits. Merge #161 first.go build,go vet,go test -race ./...) against openstackdb with #10 and #11 applied. MariaDB end-to-end tests have not yet been run against the rebased dependency.Summary
Add a Cinder quota collector, keeping the limits collector as a thin adapter, that reads Cinder's persisted quota accounting: project limits, usage and reservations, default-class limits, and per-volume-type quotas. Cinder capacity metrics move to bytes.
Metrics
All quota metrics have
tenant,tenant_idanddomain_idlabels; volume-type metrics also havevolume_type(the full type name). Prefixopenstack_cinder_:quota_volumes,quota_snapshots,quota_backups,quota_groupstype=limit,in_use,reservedquota_per_volume_byteslimits_volume_{max,used,reserved}_byteslimits_backup_{max,used,reserved}_bytesvolume_type_quota_volumes,volume_type_quota_snapshotstype=limit,in_use,reservedvolume_type_quota_bytes,volume_type_quota_{in_use,reserved}_bytesquota_upopenstack_cinder_upBehavior
DbQuotaDriverorder: project override, then the activedefaultquota-class entry, then the configured default. A NULL project override falls through. Zero and-1are preserved. Per-type resources default to-1, independently of the aggregate limit.quota_upstays1. Query failures and timeouts fail closed withquota_up=0and no quota samples.Configuration
--quota.defaults-filegains an optionalcindersection (volumes,snapshots,backups,groups,gigabytes,backup_gigabytes,per_volume_gigabytes, optionaluse_default_quota_class). Without it, Cinder 2025.2 defaults are assumed with a warning. Existing Octavia-only files remain valid.--cinder.quota-query-timeout/CINDER_QUOTA_QUERY_TIMEOUT(default5s): shared deadline for the quota reads.Breaking metric changes
Six capacity families are renamed to bytes (GiB × 2^30) without aliases:
openstack_cinder_limits_volume_max_gbopenstack_cinder_limits_volume_max_bytesopenstack_cinder_limits_volume_used_gbopenstack_cinder_limits_volume_used_bytesopenstack_cinder_limits_backup_max_gbopenstack_cinder_limits_backup_max_bytesopenstack_cinder_limits_backup_used_gbopenstack_cinder_limits_backup_used_bytesopenstack_cinder_volume_type_quota_gigabytesopenstack_cinder_volume_type_quota_bytesopenstack_cinder_volume_gbopenstack_cinder_volume_bytesThe first five also gain a
domain_idlabel, which changes series identity. Theopenstack_cinder_volume_statussizelabel stays in GiB, and volume inventory labels are unchanged. Only unlimited (-1) limits stay unscaled.Dependencies
QuotaGetAllByProject,QuotaUsageGetAllByProjectandQuotaClassGetDefaultsfrom [vexxhost/openstackdb#10](Add Cinder quota, usage and default-class queries openstackdb#10), plus feat(octavia): add project quota monitoring #161's dependency [vexxhost/openstackdb#11](Add Octavia quota limit and usage queries openstackdb#11).go.modneeds bumping to a release that includes them.PR #159 also changes the Cinder volumes collector; whichever merges second needs its README section reconciled.
Tests
Built and tested (
go build,go vet,go test -race ./...) against openstackdb with #10 and #11 applied. MariaDB end-to-end tests have not yet been run against the rebased dependency.